var ua = window.navigator.userAgent.toLowerCase();
var wechat = false;
console.log(ua);//mozilla/5.0 (iphone; cpu iphone os 9_1 like mac os x) applewebkit/601.1.46 (khtml, like gecko)version/9.0 mobile/13b143 safari/601.1

document.write('<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.12&key=39d5ce75adbc78bdffd0c9fe13e3b5eb"></script>');
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
  wechat = true;
  document.write('<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"  defer="defer" async><\/script>');
}
